<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ .title }} - ToLog</title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100vh;
            background-color: #f8f9fa;
        }
        .register-form {
            width: 100%;
            max-width: 400px;
            padding: 15px;
            margin: auto;
        }
    </style>
</head>
<body>
    <div class="register-form text-center">
        <h1 class="h3 mb-3 fw-normal">创建账户</h1>
        {{ if .error }}
        <div class="alert alert-danger" role="alert">
            {{ .error }}
        </div>
        {{ end }}
        <form action="/admin/register" method="post">
            <div class="form-floating mb-3">
                <input type="text" class="form-control" id="username" name="username" placeholder="用户名" required>
                <label for="username">用户名</label>
            </div>
            <div class="form-floating mb-3">
                <input type="email" class="form-control" id="email" name="email" placeholder="邮箱" required>
                <label for="email">邮箱</label>
            </div>
            <div class="form-floating mb-3">
                <input type="password" class="form-control" id="password" name="password" placeholder="密码" required>
                <label for="password">密码</label>
            </div>
            <div class="form-floating mb-3">
                <input type="password" class="form-control" id="confirm_password" name="confirm_password" placeholder="确认密码" required>
                <label for="confirm_password">确认密码</label>
            </div>
            <button class="w-100 btn btn-lg btn-primary" type="submit">注册</button>
        </form>
        <p class="mt-3">
            已有账户？ <a href="/admin/login">立即登录</a>
        </p>
    </div>
</body>
</html>